<?php

namespace app\api\controller;

use app\api\service\AiService;
use hunma\basic\ApiResponse;
use hunma\basic\BaseController;

class AiController extends BaseController
{
    protected $service;

    /**
     * 构造函数，初始化服务对象
     */
    public function __construct()
    {
        $this->service = new AiService();
    }

    public function get()
    {
        $rules = [
            ['message', 'require', '消息不能为空'],
        ];

        $this->parseValidationRules($rules);
        return ApiResponse::success($this->service->get(self::getAllParams()));
    }
}